<?php
	/**
	 +=========================================================
	 * 零度空间 ZD cms 网站管理系统
	 * IndexAction.class.php 首页
	 +=========================================================
	 * @copyright © 2011 nickdraw.com All rights reserved.
	 * @author NickDraw(零度温柔) webmaster@206c.net
	 * @license http://www.nickdraw.com/license
	 +=========================================================
	 */
	class IndexAction extends CommonAction {
		public function index(){
			$info = array(
	            '操作系统'						=> PHP_OS,
	            '运行环境'						=> $_SERVER["SERVER_SOFTWARE"],
	            'PHP运行方式'						=> php_sapi_name(),
	            '上传附件限制'					=> ini_get('upload_max_filesize'),
	            '执行时间限制'					=> ini_get('max_execution_time').'秒',
	            '服务器时间'						=> date("Y年n月j日 H:i:s"),
	            '北京时间'						=> gmdate("Y年n月j日 H:i:s",time()+8*3600),
	            '服务器域名/IP'					=> $_SERVER['SERVER_NAME'].' [ '.gethostbyname($_SERVER['SERVER_NAME']).' ]',
	            '剩余空间'						=> round((@disk_free_space(".")/(1024*1024)),2).'M',
	            'register_globals'				=> get_cfg_var("register_globals")=="1" ? "ON" : "OFF",
	            'magic_quotes_gpc'				=> (1===get_magic_quotes_gpc())?'YES':'NO',
	            'magic_quotes_runtime'			=> (1===get_magic_quotes_runtime())?'YES':'NO',
	        );
	        $this->assign('info',$info);
			$this->display();
		}
		
		public function getmenu(){
			$html = '';
	        $sidebar_array = unique_arr($_SESSION['au_menu_list']);
	        foreach ($sidebar_array as $key => $val){
	            if ($val['pid'] == $_GET['ID']){
					$html .='<h2 rel="'.$val['id'].'" class="list_menu_title">'.$val['title'].'</h2>';
					$html .='<ul rel="'.$val['id'].'">';
	                foreach($_SESSION['menu'.$_SESSION[C('USER_AUTH_KEY')]] as $a=>$m){
	                    if (strtolower($m['name']) != 'public' && strtolower($m['name']) != 'index'){
	                        if ($m['group_id'] == $val['id']){
	    						$html .='<li rel="'.strtolower($m['name']).'"><span></span><a href="'.U($m["name"].'/index',array('tag'=>$_GET["ID"])).'" class="menu_2_list" id="'.$a.'" target="main">'.$m['title'].'</a></li>';
	                        }
	                    }
	                }
	    			$html .='</ul>';
	    			$html .= '<div class="fo_top"></div>';
	    			$html .= '<div class="fo_bottom"></div>';
	    			$html .= '<div class="clear"></div>';
	            }
	        }
	        echo $html;
		}
		
		public function main(){
			/*foreach ($_SESSION['au_menu_list'] as $key => $val) {
				if ($_GET['tag'] == $val['id']){
					$curname = $val['title'];
					$curtpl = $val['name'];
				}
			}
			
			$this->assign("curname",$curname);
			$this->assign("default_tpl",$curtpl);*/
			
			$info = array(
	            '操作系统'=>PHP_OS,
	            '运行环境'=>$_SERVER["SERVER_SOFTWARE"],
	            'PHP运行方式'=>php_sapi_name(),
	            '上传附件限制'=>ini_get('upload_max_filesize'),
	            '执行时间限制'=>ini_get('max_execution_time').'秒',
	            '服务器时间'=>date("Y年n月j日 H:i:s"),
	            '北京时间'=>gmdate("Y年n月j日 H:i:s",time()+8*3600),
	            '服务器域名/IP'=>$_SERVER['SERVER_NAME'].' [ '.gethostbyname($_SERVER['SERVER_NAME']).' ]',
	            '剩余空间'=>round((@disk_free_space(".")/(1024*1024)),2).'M',
	            'register_globals'=>get_cfg_var("register_globals")=="1" ? "ON" : "OFF",
	            'magic_quotes_gpc'=>(1===get_magic_quotes_gpc())?'YES':'NO',
	            'magic_quotes_runtime'=>(1===get_magic_quotes_runtime())?'YES':'NO',
	        );
	        $this->assign('info',$info);
			
			$this->display();
		}
	}